If you use the global flag ( g ) in the regular expression, the replace() method will invoke the replacer function for every match. For example, if there are ... ... <看更多>
RegEx. [ ]* vs \s*. [ ]* which is same as * (space followed by a star) matches zero or more occurrences of space. This is not flexible as it ... ... <看更多>